<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">

    <ui:define name="content"> 
        <f:view beforePhase="#{mealManagerBean.initMealList}"/>
        <h:form>  
            <p:dataTable var="mealList" value="#{mealManagerBean.mealList}" paginator="true" rows="15"  
                         selection="#{mealManagerBean.selectedMeal}" selectionMode="single"  
                         onRowSelectUpdate="display" rowSelectListener="#{mealManagerBean.onRowSelectNavigateMeal}"
                         dblClickSelect="true"
                         emptyMessage ="No meal found.">  

                <f:facet name="header">  
                    List of Meals  
                </f:facet>  

                <p:column sortBy="#{mealList.name}" filterBy="#{mealList.name}">  
                    <f:facet name="header">  
                        <h:outputText value="Meal Name" />  
                    </f:facet>  
                    <h:outputText value="#{mealList.name}" />  
                </p:column>  

                <p:column sortBy="#{mealList.originalPrice}" filterBy="#{mealList.originalPrice}">  
                    <f:facet name="header">  
                        <h:outputText value="Original Price" />  
                    </f:facet>  
                    <h:outputText value="#{mealList.originalPrice}" />  
                </p:column>  

                <p:column sortBy="#{mealList.description}" filterBy="#{mealList.description}">  
                    <f:facet name="header">  
                        <h:outputText value="Description" />  
                    </f:facet>  
                    <h:outputText value="#{mealList.description}" />  
                </p:column> 

                <p:column sortBy="#{mealList.videoLink}" filterBy="#{mealList.videoLink}">  
                    <f:facet name="header">  
                        <h:outputText value="Video Link" />  
                    </f:facet>  
                    <h:outputText value="#{mealList.videoLink}" />  
                </p:column> 

                <p:column sortBy="#{mealList.visibility}" filterBy="#{mealList.visibility}">  
                    <f:facet name="header">  
                        <h:outputText value="Visible to customers" />  
                    </f:facet>  
                    <h:outputText value="#{mealList.visibility}" />  
                </p:column> 
            </p:dataTable> 
        </h:form> 
    </ui:define>
</ui:composition>